<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->group([
    'namespace' => 'App\Http\Controllers'
], function ($app) {
    //页面路由
    $app->get('', 'DefaultController@index');
    $app->get('/index', 'DefaultController@index');
    $app->get('/index.html', 'DefaultController@index');
    $app->get('/welcome.html', 'DefaultController@welcome');
    $app->get('/login.html', 'DefaultController@login');
    $app->get('/forget.html', 'DefaultController@forget');
    $app->get('/register.html', 'DefaultController@register');
    $app->get('/manager.html', 'ManagerController@index');
    $app->get('/manager/work.html', 'ManagerController@work');
    $app->get('/manager/work-mark.html', 'ManagerController@workMark');
    $app->get('/manager/detail/{id}.html', 'ManagerController@detail');
    $app->get('/manager/category.html', 'ManagerController@category');
    $app->get('/manager/category-create.html', 'ManagerController@createCategory');
    $app->get('/manager/category-edit/{id}.html', 'ManagerController@editCategory');
    $app->get('/manager/user.html', 'ManagerController@user');
    $app->get('/manager/user-create.html', 'ManagerController@createUser');
    $app->get('/manager/user-edit/{id}.html', 'ManagerController@editUser');
    $app->get('/manager/file.html', 'ManagerController@file');
    $app->get('/manager/file-edit.html', 'ManagerController@editFile');
    $app->get('/manager/set.html', 'ManagerController@set');
    $app->get('/manager/export.html', 'ManagerController@export');
    $app->get('/teacher.html', 'TeacherController@index');
    $app->get('/teacher/work.html', 'TeacherController@work');
    $app->get('/teacher/detail/{id}.html', 'TeacherController@detail');
    $app->get('/teacher/file.html', 'TeacherController@file');
    $app->get('/teacher/file-edit.html', 'TeacherController@editFile');
    $app->get('/teacher/set.html', 'TeacherController@set');
    $app->get('/student.html', 'StudentController@index');
    $app->get('/student/file.html', 'StudentController@file');
    $app->get('/student/file-edit.html', 'StudentController@editFile');
    $app->get('/student/work.html', 'StudentController@work');
    $app->get('/student/work-create.html', 'StudentController@createWork');
    $app->get('/student/work-edit.html', 'StudentController@editWork');
    $app->get('/student/set.html', 'StudentController@set');
    //接口路由
    $app->get('/categories.json', 'DefaultController@categories');
    $app->post('/signIn', 'DefaultController@signIn');
    $app->post('/signUp', 'DefaultController@signUp');
    $app->post('/upload', 'UploadController@index');
    $app->post('/sendEmail', 'DefaultController@sendEmail');
});

$app->group([
    'namespace' => 'App\Http\Controllers\V1'
], function ($app) {
    //接口路由
    $app->get('/v1/check.json', 'UserController@check');
    $app->get('/v1/manager/user/list.json', 'ManagerController@userList');
    $app->get('/v1/manager/get/user.json', 'ManagerController@info');
    $app->get('/v1/manager/work/list.json', 'ManagerController@workList');
    $app->get('/v1/manager/work/mark-list.json', 'ManagerController@markList');
    $app->get('/v1/manager/export.html', 'ManagerController@export');
    $app->get('/v1/manager/get/file.json', 'ManagerController@getFile');
    $app->get('/v1/manager/category/list.json', 'ManagerController@categoryList');
    $app->get('/v1/manager/get/category.json', 'ManagerController@getCategory');
    $app->get('/v1/manager/get/work.json', 'ManagerController@getWork');
    $app->get('/v1/manager/get/detail.json', 'ManagerController@getDetail');
    $app->post('/v1/manager/saveScore', 'ManagerController@saveScore');
    $app->post('/v1/manager/saveCategory', 'ManagerController@saveCategory');
    $app->post('/v1/manager/updateCategory', 'ManagerController@updateCategory');
    $app->post('/v1/manager/deleteCategory', 'ManagerController@deleteCategory');
    $app->post('/v1/manager/saveUser', 'ManagerController@saveUser');
    $app->post('/v1/manager/updateUser', 'ManagerController@updateUser');
    $app->post('/v1/manager/deleteUser', 'ManagerController@deleteUser');
    $app->post('/v1/manager/updateFile', 'ManagerController@updateFile');
    $app->post('/v1/manager/changePass', 'ManagerController@changePass');
    $app->get('/v1/student/get/file.json', 'StudentController@getFile');
    $app->get('/v1/student/work/list.json', 'StudentController@workList');
    $app->get('/v1/student/ get/work.json', 'StudentController@getWork');
    $app->post('/v1/student/saveWork', 'StudentController@saveWork');
    $app->post('/v1/student/deleteWork', 'StudentController@deleteWork');
    $app->post('/v1/student/updateFile', 'StudentController@updateFile');
    $app->post('/v1/student/changePass', 'StudentController@changePass');
    $app->get('/v1/teacher/work/list.json', 'TeacherController@workList');
    $app->get('/v1/teacher/get/work.json', 'TeacherController@getWork');
    $app->get('/v1/teacher/get/detail.json', 'TeacherController@getDetail');
    $app->get('/v1/teacher/get/file.json', 'TeacherController@getFile');
    $app->post('/v1/teacher/saveScore', 'TeacherController@saveScore');
    $app->post('/v1/teacher/updateFile', 'TeacherController@updateFile');
    $app->post('/v1/teacher/changePass', 'TeacherController@changePass');
});
